<template>
  <div>
    <div class="row tags-content content-block">
      <h2 class="title"><strong>本站标签</strong></h2>
      <div class="col-xs-3" v-for="(tag,index) in arrTags" :key="index">
        <span
          class="tags"
          data-toggle="tooltip"
          data-placement="bottom"
          :title="'查看关于 '+tag.LableName+' 的文章'"
        >
          <a :href="'/search?lableId='+tag.LableId+''">{{tag.LableName}}</a>
        </span>
        <p>
          查看关于 {{tag.LableName}} 的文章
        </p>
      </div>
    </div>
  </div>
</template>
<script>
export default {
  name: 'tags',
  data () {
    return {
      arrTags: []
    }
  },
  created () {
    this.getTags()
  },
  methods: {
    // 获取本站所有标签
    getTags () {
      this.$axios
        .get(config.blogService.blogHostUrl + 'api/blog/tags', {
          params: {}
        })
        .then(res => {
          console.log(res)
          if (res.status === 200) {
            this.arrTags = res.data.Data
          }
        })
        .catch(err => {
          console.log(err)
        })
    }
  }
}
</script>
<style >
</style>
